package xyz.xuminghai.javafx_learn.scene.control;

import javafx.application.Application;
import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Separator;
import javafx.scene.control.TitledPane;
import javafx.scene.control.ToolBar;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;

/**
 * 2023/5/24 15:05 星期三<br/>
 * 工具栏
 *
 * @author xuMingHai
 */
public class ToolBarApp extends Application {

    private final BorderPane borderPane = new BorderPane();


    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void init() {
        ToolBar toolBar = new ToolBar(new Button("button1"),
                new Separator(),
                new Button("button2"),
                new Separator(),
                new Button("button3"),
                new Separator(),
                new Button("button4"),
                new Button("button5"),
                new Separator(),
                new Button("button6"),
                new Button("button7"),
                new Separator(),
                new Button("button8"),
                new Button("button9"),
                new Separator(),
                new Button("button10"),
                new Button("button11"),
                new Button("button12"),
                new Button("button13"),
                new Button("button14"),
                new Separator(),
                new Button("button15"),
                new Button("button16"),
                new Button("button17"),
                new Separator(),
                new Button("button18"),
                new Button("button19"),
                new Separator(),
                new Button("button20"),
                new Button("button21"));
        toolBar.setOrientation(Orientation.VERTICAL);


        borderPane.setRight(new TitledPane("工具", toolBar));
    }

    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle(getClass().getSimpleName());
        Scene scene = new Scene(borderPane, 800, 600);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}
